package com.xiaoran.springcloud.controller;


import com.xiaoran.springcloud.entitis.CommonResult;
import com.xiaoran.springcloud.entitis.Payment;
import com.xiaoran.springcloud.server.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderFeginController {
    @Resource
    private PaymentService paymentService;
    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult test(@PathVariable("id") int id){
        return paymentService.getPaymentById(id);
    }
    @GetMapping("/consumer/payment/fegin/timeout")
    public String test2(){
        //客户端默认只等一秒
        return paymentService.test2();
    }
}
